package com.jfeat.am.module.wegou.exception;

import com.jfeat.am.common.exception.BusinessException;

/**
 * Created by Administrator on 2018/1/30.
 */
public enum WegouBizException {
    CATEGORY_CANNOT_BE_HIS_OWN_CHILD(2000, "不能作为自己的子类别！"),
    CANNOT_DELETE_WITH_CHILDREN(2001, "不能删除拥有子类别的类别！"),
    CANNOT_DELETE_REF_SOME_PRODUCTS(2002, "该类别下存在菜单，请先删除菜单！"),
    IDENTITY_IS_REQUIRED(2003, "必须要注册的商户类型"),
    NOT_YOUR_PRODUCT_TYPE(2004, "不允许操作非本店铺的菜单类别"),
    DULPLICATED_PRODUCT_TYPE_NAME(2005, "本店铺已存在相同的菜单类别名：%s"),
    NOT_YOUR_PRODUCT(2006, "不允许操作非本店铺的菜单"),
    NO_PERMISSION(2007, "无权限进行该操作"),
    LOGIN_IDENTITY_REQUIRED(2008, "登录失败，必须选择您的身份"),
    LOGIN_IDENTITY_NOT_MATCH(2008, "登录失败，请检查您的身份（平台用户/料理店铺/商户店铺）"),
    NOT_ADMIN(2009, "您不是管理员，请联系管理员"),
    NOT_RESTAURANT_OR_CANTEEN(2010, "您不是料理店铺或者商户店铺，请联系管理员"),
    NOT_CANTEEN(2011, "您不是商户店铺，请联系管理员"),
    UNKNOWN_IDENTITY(2012, "未知的身份信息,不能进行此操作"),
    REGISTER_FAILURE(2013, "注册失败"),
    ACCOUNT_CREATE_FAILURE(2014, "账号创建失败"),
    SHOP_LOCKED(2015, "您的店铺已被锁定，请联系管理员"),
    GET_EXCHANGE_RATE_FAILED(2016,"获取汇率失败");


    private int code;
    private String message;

    WegouBizException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public BusinessException create(){
        return new BusinessException(code,message);
    }
}
